package desgin.pattern.behavior.filterchain;

/**
 * filter-chain 设计模式 filterchain也是一个filter 每一个filter只需要知道处理或者往下传
 * 
 * @Type Main
 * @Desc
 * @author shuai.zuo
 * @date 2015年2月5日
 * @Version V1.0
 */
public class Main {
    public static void main(String[] args) {
        FilterChain chain = new FilterChain();
        chain.addFilter(new HtmlFilter()).addFilter(new SensitiveFilter());
        Request request = new Request();
        request.request = "request";
        Response response = new Response();
        response.response = "response";
        chain.doFilter(request, response, chain);
        // result
        System.out.println(request.request);
        System.out.println(response.response);
    }
}
